#include <stdio.h>
#include <unistd.h>
#include <string.h>

#define NUM 101
#define STYLE '='

void process()
{
    int cnt = 0;
    char bar[NUM];
    const char* lable = "|/-\\";
    int len = strlen(lable);
    memset(bar,'\0',sizeof(bar));
    while(cnt <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", bar,cnt,lable[cnt%len]);
        fflush(stdout);
        bar[cnt] = STYLE;
        cnt++;
        if (cnt == NUM) break;
        bar[cnt] = '>';
        usleep(20000);
    }
}
